package com.itheima.interface3;
//打印全班信息 打印平均分
public class Function1 implements Function {
    Student[] students;
    public Function1(Student[] students) {
        this.students = students;
    }
    @Override
    public void printAllscore() {
        for(int i=0;i<students.length;i++)
        {
            System.out.println(students[i].getName()+"---"+students[i].getAge()+"---"+students[i].getScore());
        }
    }

    @Override
    public void printAvgScore() {
        double sum=0;
        for(int i=0;i<students.length;i++)
        {
            sum+=students[i].getScore();
        }
    }
}
